.class public Lcom/instagram/android/mediacache/CircularImageView;
.super Lcom/instagram/android/mediacache/IgImageView;
.source "CircularImageView.java"


# instance fields
.field private b:I


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 28
    invoke-direct {p0, p1}, Lcom/instagram/android/mediacache/IgImageView;-><init>(Landroid/content/Context;)V

    .line 29
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 32
    invoke-direct {p0, p1, p2}, Lcom/instagram/android/mediacache/IgImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 33
    invoke-direct {p0, p2}, Lcom/instagram/android/mediacache/CircularImageView;->a(Landroid/util/AttributeSet;)V

    .line 34
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 37
    invoke-direct {p0, p1, p2, p3}, Lcom/instagram/android/mediacache/IgImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 38
    invoke-direct {p0, p2}, Lcom/instagram/android/mediacache/CircularImageView;->a(Landroid/util/AttributeSet;)V

    .line 39
    return-void
.end method

.method private a(I)Landroid/graphics/drawable/GradientDrawable;
    .locals 2
    .parameter

    .prologue
    .line 80
    new-instance v0, Lcom/instagram/android/mediacache/v;

    iget v1, p0, Lcom/instagram/android/mediacache/CircularImageView;->b:I

    invoke-direct {v0, v1}, Lcom/instagram/android/mediacache/v;-><init>(I)V

    .line 82
    invoke-virtual {v0, p1}, Landroid/graphics/drawable/GradientDrawable;->setColor(I)V

    .line 83
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/graphics/drawable/GradientDrawable;->setShape(I)V

    .line 84
    return-object v0
.end method

.method private a(Landroid/util/AttributeSet;)V
    .locals 3
    .parameter

    .prologue
    .line 42
    invoke-virtual {p0}, Lcom/instagram/android/mediacache/CircularImageView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    sget v1, Lcom/facebook/au;->circular_avatar_stroke_width:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v0

    iput v0, p0, Lcom/instagram/android/mediacache/CircularImageView;->b:I

    .line 44
    invoke-virtual {p0}, Lcom/instagram/android/mediacache/CircularImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    sget-object v1, Lcom/facebook/bc;->IgImageView:[I

    invoke-virtual {v0, p1, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object v0

    .line 45
    sget v1, Lcom/facebook/bc;->IgImageView_placeholder:I

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getColor(II)I

    move-result v1

    .line 46
    invoke-direct {p0, v1}, Lcom/instagram/android/mediacache/CircularImageView;->a(I)Landroid/graphics/drawable/GradientDrawable;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/instagram/android/mediacache/CircularImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 47
    invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

    .line 48
    return-void
.end method

.method private getScreenDensity()I
    .locals 1

    .prologue
    .line 76
    invoke-virtual {p0}, Lcom/instagram/android/mediacache/CircularImageView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->densityDpi:I

    return v0
.end method


# virtual methods
.method public setImageBitmap(Landroid/graphics/Bitmap;)V
    .locals 4
    .parameter "bm"

    .prologue
    .line 52
    new-instance v0, Lcom/instagram/android/mediacache/t;

    invoke-virtual {p0}, Lcom/instagram/android/mediacache/CircularImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    iget v1, v1, Landroid/view/ViewGroup$LayoutParams;->width:I

    invoke-virtual {p0}, Lcom/instagram/android/mediacache/CircularImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v2

    iget v2, v2, Landroid/view/ViewGroup$LayoutParams;->height:I

    iget v3, p0, Lcom/instagram/android/mediacache/CircularImageView;->b:I

    invoke-direct {v0, p1, v1, v2, v3}, Lcom/instagram/android/mediacache/t;-><init>(Landroid/graphics/Bitmap;III)V

    invoke-virtual {p0, v0}, Lcom/instagram/android/mediacache/CircularImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 56
    return-void
.end method

.method public setImageDrawable(Landroid/graphics/drawable/Drawable;)V
    .locals 3
    .parameter "drawable"

    .prologue
    .line 60
    instance-of v0, p1, Landroid/graphics/drawable/BitmapDrawable;

    if-eqz v0, :cond_0

    .line 61
    check-cast p1, Landroid/graphics/drawable/BitmapDrawable;

    .end local p1
    invoke-virtual {p1}, Landroid/graphics/drawable/BitmapDrawable;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/instagram/android/mediacache/CircularImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 73
    :goto_0
    return-void

    .line 62
    .restart local p1
    :cond_0
    instance-of v0, p1, Lcom/instagram/android/mediacache/b;

    if-eqz v0, :cond_1

    .line 64
    check-cast p1, Lcom/instagram/android/mediacache/b;

    .line 65
    .end local p1
    invoke-virtual {p1}, Lcom/instagram/android/mediacache/b;->a()I

    move-result v0

    invoke-direct {p0, v0}, Lcom/instagram/android/mediacache/CircularImageView;->a(I)Landroid/graphics/drawable/GradientDrawable;

    move-result-object v0

    invoke-super {p0, v0}, Lcom/instagram/android/mediacache/IgImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 66
    .restart local p1
    :cond_1
    instance-of v0, p1, Lcom/instagram/android/mediacache/a;

    if-nez v0, :cond_2

    instance-of v0, p1, Landroid/graphics/drawable/GradientDrawable;

    if-eqz v0, :cond_3

    .line 68
    :cond_2
    invoke-super {p0, p1}, Lcom/instagram/android/mediacache/IgImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 70
    :cond_3
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "This view doesn\'t support drawable type: "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public setImageResource(I)V
    .locals 2
    .parameter "resId"

    .prologue
    .line 89
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "Use setImageDrawable or setImageBitmap"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public setImageURI(Landroid/net/Uri;)V
    .locals 2
    .parameter "uri"

    .prologue
    .line 94
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "Use setImageDrawable or setImageBitmap"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method
